<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
    <form action="?" method="post" id="dform">
        <input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
        <input type="hidden" name="file" value="<?php echo $file;?>"/>
        <input type="hidden" name="action" value="<?php echo $action;?>"/>
        <input type="hidden" name="itemid" value="<?php echo $itemid;?>"/>
        <input type="hidden" name="forward" value="<?php echo $forward;?>"/>
        <input type="hidden" name="post[mycatid]" value="<?php echo $mycatid;?>"/>
        <div class="tt"><?php echo $tname;?></div>
        <table cellpadding="2" cellspacing="1" class="tb">
            <tr>
                <td class="tl"><span class="f_red">*</span> 信息标题</td>
                <td><input name="post[title]" type="text" id="title" size="60" datatype="*2-999" nullmsg="请填写标题" errormsg="最少输入2个字符" value="<?php echo $title;?>"/> <?php echo level_select('post[level]', '级别', $level, 'id="level"');?></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_red">*</span> 所属分类</td>
                <td><?php echo Post::catTree('post[catid]', $moduleid, '选择分类' ,$catid, 'datatype="n" nullmsg="请选择分类"');?></td>
            </tr>
            <tr id="carcatTr" >
                <td class="tl">&nbsp;&nbsp;&nbsp;适用车型</td>
                <td class="tr">
                    <?php echo Post::autoCombo('post[arbid][]','post[arcid][]', 'post[amid][]', $item['arbid'],$item['arcid'],$item['amid'], 0, 0, 0) ;?>
                </td>
            </tr>

            <tr id="sell_model"style="display: none;">
                <td class="tl"><span class="f_hid">*</span> 产品型号</td>
                <td><input name="post[model]" type="text" size="30" value="<?php echo $model;?>"/></td>
            </tr>
            <tr id="sell_standard"style="display: none;">
                <td class="tl"><span class="f_hid">*</span> 产品规格</td>
                <td><input name="post[standard]" type="text" size="30" value="<?php echo $standard;?>"/></td>
            </tr>
            <tr id="sell_brand"style="display: none;">
                <td class="tl"><span class="f_hid">*</span> 产品品牌</td>
                <td><input name="post[brand]" type="text" size="30" value="<?php echo $brand;?>"/></td>
            </tr>
            <tr id="sell_introduce">
                <td class="tl"><span class="f_hid">*</span>招商说明</td>
                <td><textarea name="post[introduce]" style="width:90%;height:45px;"><?php echo $introduce;?></textarea></td></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 招商详细说明</td>
                <td><?php echo Post::kindEditor('post[content]', $moduleid, $content, 'datatype="*5-99999" nullmsg="请填写内容" errormsg="内容最少5字"','800px'); ?></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 招商图片</td>
                <td><?php echo Post::picture($moduleid, 'thumb', 'post[thumb]', $thumb ,$MOD['thumb_width'], $MOD['thumb_height']);?></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 招商图片</td>
                <td><?php echo Post::picture($moduleid, 'thumb', 'post[thumb1]', $thumb1 ,$MOD['thumb_width'], $MOD['thumb_height']);?></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 招商图片</td>
                <td><?php echo Post::picture($moduleid, 'thumb', 'post[thumb2]', $thumb2 ,$MOD['thumb_width'], $MOD['thumb_height']);?></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 过期时间</td>
                <td><?php echo Post::calender('post[totime]', $totime, 'width:90', true); ?></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_red">*</span> 地区</td>
                <td class="tr"><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?> <span id="dareaid" class="f_red"></span></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 会员信息</td>
                <td>
                    <input type="radio" name="ismember" value="1" <?php if ($username) echo 'checked';?> onclick="Dh('d_guest');Ds('d_member');Dd('username').value='<?php echo $username;?>';" id="ismember_1"/><label for="ismember_1"> 是</label>&nbsp;&nbsp;&nbsp;
                    <input type="radio" name="ismember" value="0" <?php if (!$username) echo 'checked';?> onclick="Dh('d_member');Ds('d_guest');Dd('username').value='';" id="ismember_0"/><label for="ismember_0"> 否</label>
                </td>
            </tr>
            <tbody id="d_member" style="display:<?php echo $username ? '' : 'none';?>">
            <tr>
                <td class="tl"><span class="f_red">*</span> 会员名</td>
                <td><input name="post[username]" type="text" size="20" value="<?php echo $username;?>"  id="username"/> <a href="javascript:_user(Dd('username').value);" class="t">[资料]</a> <span id="dusername" class="f_red"></span></td>
            </tr>

            </tbody>
            <tbody id="d_guest" style="display:<?php echo $username ? 'none' : '';?>">
            <tr>
                <td class="tl"><span class="f_red">*</span> 公司名称</td>
                <td class="tr"><input name="post[company]" type="text" id="company" size="50" value="<?php echo $company;?>"/> 个人请填 姓名(个人) 例如：张三(个人)<br/><span id="dcompany" class="f_red"></span></td>
            </tr>

            <tr>
                <td class="tl"><span class="f_red">*</span> 联系人</td>
                <td class="tr"><input name="post[truename]" type="text" id="truename" size="20" value="<?php echo $truename;?>"/> <span id="dtruename" class="f_red"></span></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_red">*</span> 联系手机</td>
                <td class="tr"><input name="post[mobile]" id="mobile" type="text" size="30" value="<?php echo $mobile;?>"/> <span id="dmobile" class="f_red"></span></td>
            </tr>
            <tr style="display: none">
                <td class="tl"><span class="f_hid">*</span> 电子邮件</td>
                <td class="tr"><input name="post[email]" id="email" type="text" size="30" value="<?php echo $email;?>"/> <span id="demail" class="f_red"></span></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 联系电话</td>
                <td class="tr"><input name="post[telephone]" id="telephone" type="text" size="30" value="<?php echo $telephone;?>"/> <span id="dtelephone" class="f_red"></span></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 联系地址</td>
                <td class="tr"><input name="post[address]" type="text" size="60" value="<?php echo $address;?>"/></td>
            </tr>

            </tbody>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 信息状态</td>
                <td>
                    <input type="radio" name="post[status]" value="3" <?php if ($status == 3) echo 'checked';?>/> 通过
                    <input type="radio" name="post[status]" value="2" <?php if ($status == 2) echo 'checked';?>/> 待审
                    <input type="radio" name="post[status]" value="1" <?php if ($status == 1) echo 'checked';?> onclick="if(this.checked) Dd('note').style.display='';"/> 拒绝
                    <input type="radio" name="post[status]" value="4" <?php if ($status == 4) echo 'checked';?>/> 过期
                    <input type="radio" name="post[status]" value="0" <?php if ($status == 0) echo 'checked';?>/> 删除
                </td>
            </tr>
            <tr id="note" style="display:<?php echo $status == 1 ? '' : 'none';?>">
                <td class="tl"><span class="f_red">*</span> 拒绝理由</td>
                <td><input name="post[note]" type="text" size="40" value="<?php echo $note;?>"/></td>
            </tr>
            <tr>
                <td class="tl"><span class="f_hid">*</span> 添加时间</td>
                <td><?php echo Post::datetimeBox('post[addtime]', $addtime, 'width:140'); ?></td>
            </tr>
	        <tr>
		        <th class="tl">发布区域</th>
		        <td >
			        <input id="J_AreaNames" class="J_MultiIpt fn-left" type="text" size="30" value="<?php echo $cityname?>">
			        <input id="J_CityIds" type="hidden" value="<?php echo $citys;?>" name="post[city]" >
			        <input id="J_AreaIds" type="hidden" value="<?php echo $citys;?>">
			        <button id="J_SelectArea" type="button" class="J_MultiSubmit fn-left">选择</button>
		        </td>
	        </tr>
        </table>
        <div class="sbt"><input type="submit" name="submit" value=" 确 定 " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="btn"/></div>
    </form>
    <script type="text/javascript">
        seajs.use(['$', 'vf', 'vf-css', 'easyui','easyui-css'], function($){
            $('#dform').Validform({
                beforeCheck:function(curform){
                    lemon.editor.post_content_.sync();
                }
            });
        })
    </script>
	<script>
		seajs.use(['mod-multiAreaSel','mod-multiAreaSel-css'], function(MultiArea){
			$("#J_SelectArea").click(function(){
				var appView = new MultiArea({
					areaIds:$("#J_AreaIds"),
					areaNames:$("#J_AreaNames"),
					cityIds:$("#J_CityIds"),
					dataUrl:lemon.site_url+"api/area/multiAreaSel.php"
				});
				console.log(appView);
				$("body").append(appView.el);
			});
		});
	</script>
    <script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer'); ?>